import { Episodes_get_start, Episodes_get_success, Episodes_get_fail } from "../Type"

let epispdes_info = {
    state: 'default',
    get: false,
    loading: false,
    data: []
}

const Episodes = (status = epispdes_info, action) => {
    if (action.type === Episodes_get_start) {
        return {
            state: action.msg,
            get: false,
            loading: true,
            data: []
        }
    }
    if (action.type === Episodes_get_success) {
        return {
            state: action.msg,
            get: true,
            loading: true,
            data: action.data
        }
    }
    if (action.type === Episodes_get_fail) {
        return {
            state: action.msg,
            get: false,
            loading: false,
            data: []
        }
    }
    return status;
}

export default Episodes